package cn.etynit.service.impl;

import cn.etynit.domain.Activity;
import cn.etynit.exception.GlobalExceptionCodeEnum;
import cn.etynit.mapper.ActivityMapper;
import cn.etynit.service.IActivityService;
import cn.etynit.util.AssertUtil;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author etyn
 * @since 2022-12-10
 */
@Service
public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> implements IActivityService {

    @Autowired
    private ActivityMapper activityMapper;



    /**
     * 根据活动标题查询活动是否存在
     * @param title
     * @return
     */
    @Override
    public void findByTitle(String title) {
        Activity byTitle = activityMapper.findByTitle(title);
        AssertUtil.isNull(byTitle,GlobalExceptionCodeEnum.ERROR);
    }
}
